﻿package idv.sais.ezcin;

import java.io.*;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TableLayout;
import android.view.View;
import android.widget.TextView;

public class AboutActivity extends Activity {
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.about);
        TableLayout txtTitleBar = (TableLayout)findViewById(R.id.TitleBar);
        txtTitleBar.setBackgroundColor(Color.WHITE);
        TextView txtTitle = (TextView)findViewById(R.id.Title);
        txtTitle.setTextColor(Color.BLACK);

        TextView txtAbout = (TextView)findViewById(R.id.AboutString);
        String strAbout = "";
        try
        {
        	InputStreamReader ir = new InputStreamReader(this.getResources().openRawResource(R.raw.about));
        	BufferedReader br = new BufferedReader(ir);
        	while(br.ready())
        		strAbout += br.readLine() + "\n";
        }
        catch(Exception e)
        {
        	strAbout = "無法讀取版權宣告資訊。";
        }
        txtAbout.setText(strAbout);
        
        Button btnExit = (Button)findViewById(R.id.EndButton);
        btnExit.setOnClickListener(new Button.OnClickListener() {
        	public void onClick(View v) {
        		AboutActivity.this.finish();
        	}
        });
        
    }
}